define(function () {
    'use strict';

    function ctrl($scope,$state,LocalCacheService) {

        $scope.$on('$ionicView.beforeEnter', function() {
            $scope.user = LocalCacheService.getUser();
        });

        //回退固定为账户首页
        $scope.onBackKeyDown = function(){
            $state.go("tab.account-index");
        };
    }

    ctrl.$inject = ['$scope','$state','LocalCacheService'];
    return ctrl;
});